﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucGiangVien.ascx.cs"
    Inherits="STT.Admin.UserControls.ucGiangVien" %>

<style>
    #thediv_scroll1 {
        height: 100px;
        width: 100%;
        margin-left: 0px;
        overflow: auto; /* thuoc tinh nay lam xuat hien thanh cuon*/
    }


    #thediv_canle {
        padding-left: 40px;
    }
</style>

<%--<div id="content-header">
    <div id="breadcrumb">
        <a href="../Admin/Default.aspx?idpage=1" class="tip-bottom" data-original-title="Về bảng điều khiển">
            <i class="icon-home"></i>Trang chính
        </a>
        <a href="../Admin/Default.aspx?idpage=qlgv" class="current">Quản lý giảng viên</a>
        <a href="#" class="current">Danh sách giảng viên</a>
    </div>
</div>--%>

<div class="widget-box">
    <div class="control-group" style="border: thin solid #CCCCFF">
        <asp:Panel ID="plError" runat="server" Visible="false">
            <br />
            <div id="thediv_scroll1">
                <div id="thediv_canle">
                    <asp:Label ID="lbError" runat="server" ForeColor="Red"></asp:Label>
                </div>
            </div>
            <br />
        </asp:Panel>
    </div>

    <div class="widget-title">
        <span class="icon"><i class="icon-th"></i></span>
        <h5>Danh sách giảng viên</h5>

        <div id="search">
            <asp:TextBox ID="txtTimKiem" runat="server" placeholder="Nhập từ tìm kiếm..."></asp:TextBox>
            <button class="tip-left" data-original-title="Tìm kiếm">
                <asp:ImageButton ID="btSearch" runat="server" ImageUrl="~/img/icon-search.png" OnClick="btSearch_Click" />
            </button>
        </div>
    </div>

    <div class="widget-content nopadding">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
            <asp:GridView ID="gvGiangVien" runat="server" CssClass="table table-bordered table-hover"
                AutoGenerateColumns="False" DataKeyNames="MaGV"
                OnRowCommand="gvGiangVien_RowCommand"
                EnableViewState="False" OnRowDeleting="gvGiangVien_RowDeleting"
                AllowPaging="True" PageSize="20">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbChonTat" runat="server" onclick="cbChonTat(this);" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbChon" runat="server" onclick="cbChon(this);" />
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:BoundField DataField="MaGV" HeaderText="Mã giảng viên"
                        InsertVisible="False" ReadOnly="True" SortExpression="MaGV"
                        ItemStyle-CssClass="span1">
                        <ItemStyle CssClass="span1"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenGV" HeaderText="Tên giảng viên"
                        SortExpression="TenGV" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <%--<asp:BoundField DataField="DiaChi" HeaderText="Địa chỉ"
                        SortExpression="DiaChi" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>--%>
                    <asp:BoundField DataField="Sdt" HeaderText="Số điện thoại"
                        SortExpression="Sdt" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenDonVi" HeaderText="Đơn vị"
                        SortExpression="TenDonVi" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenChucVu" HeaderText="Chức vụ"
                        SortExpression="TenChucVu" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <%-- <asp:BoundField DataField="SoCMT" HeaderText="Số CMT"
                        SortExpression="SoCMT" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>--%>
                    <%--    <asp:BoundField DataField="TenTDChuyenMon" HeaderText="Chuyên môn"
                        SortExpression="TenTDChuyenMon" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>--%>
                    <asp:BoundField DataField="TenTDHocVan" HeaderText="Học vấn"
                        SortExpression="TenTDHocVan" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <%--   <asp:BoundField DataField="GhiChu" HeaderText="Ghi chú"
                        SortExpression="GhiChu" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>--%>
                    <asp:TemplateField HeaderText="Chi tiết" ShowHeader="False">
                        <ItemTemplate>
                            <a href="#thongTin" data-toggle="modal" onclick="Display(<%# "'"+ Eval("TenGV").ToString().TrimEnd()+"','"+ Eval("SDT").ToString().TrimEnd()+"','"+ Eval("TenDonVi").ToString().TrimEnd()+"','"+ Eval("TenChucVu").ToString().TrimEnd()+"','"+ Eval("TenTDHocVan").ToString().TrimEnd()+"','"+ Eval("DiaChi").ToString().TrimEnd()+"','"+ Eval("SoCMT").ToString().TrimEnd()+"','"+ Eval("TenTDChuyenMon").ToString().TrimEnd()+"','"+ Eval("GhiChu").ToString().TrimEnd() +"'"%>)">
                                <img src="../../img/detail.jpg" alt="Alternate Text" />
                            </a>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sửa" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                                Text="Sửa" CommandArgument="<%#((GridViewRow)Container).RowIndex%>" CommandName="ChonSua">
                                <img src="../../img/edit.jpg" alt="Alternate Text" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa" ShowHeader="False">
                        <ItemTemplate>
                            <%-- Bắt sự kiện nhấn nút xóa --%>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa?');">
                                <img src="../../img/delete.jpg" alt="Alternate Text" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>

            <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">

                <asp:LinkButton ID="lbXoaTat" runat="server" CssClass="btn" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa các dòng đã chọn?');"
                    OnClick="lbXoaTat_Click">Xóa chọn</asp:LinkButton>

                <div class="btn-group">
                    <asp:LinkButton ID="LinkButton3" runat="server" CssClass="btn" OnClick="LinkButton3_Click">Thêm mới</asp:LinkButton>

                    <button data-toggle="dropdown" class="btn dropdown-toggle">
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="#themFileExcel" data-toggle="modal">Thêm từ file Excel</a></li>
                        <%-- Bắt sự kiện nhấn nút xóa --%>
                    </ul>
                </div>

                <div class="btn-group">
                    <asp:HyperLink ID="HyperLink2" CssClass="btn" Target="_blank" runat="server" NavigateUrl="~/Report/ViewGiangVien.aspx">                        
                            Xuất dữ liệu
                    </asp:HyperLink>

                </div>
                <div class="btn-group">
                    <a href="#SuaFileExcel" data-toggle="modal">
                        <button class="btn">Sửa Excel</button>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="validationcontrol">


    <div id="themFileExcel" class="modal hide" aria-hidden="true" style="display: none;">
        <div class="modal-header">
            <button data-dismiss="modal" class="close" type="button">×</button>
            <h3 runat="server" id="H1">Thêm từ file Excel</h3>
        </div>
        <div class="modal-body">
            <asp:FileUpload ID="FileUpload" runat="server" />
        </div>
        <div class="modal-footer">
            <asp:Button ID="btThemExcel" runat="server" CssClass="btn btn-primary" Text="Thêm từ file"
                OnClick="btThemExcel_Click" />
            <a data-dismiss="modal" class="btn" href="#">Hủy</a>
        </div>
    </div>
</div>

<div id="SuaFileExcel" class="modal hide" aria-hidden="true" style="display: none;">
    <div class="modal-header">
        <button data-dismiss="modal" class="close" type="button">×</button>
        <h3 runat="server" id="H2">Sửa từ file Excel</h3>
    </div>
    <div class="modal-body">
        <asp:FileUpload ID="fuSuaExcel" runat="server" />
    </div>
    <div class="modal-footer">
        <asp:Button ID="btSuaExcel" runat="server" CssClass="btn btn-primary" Text="Sửa từ file"
            OnClick="btSuaExcel_Click" />
        <a data-dismiss="modal" class="btn" href="#">Hủy</a>
    </div>
</div>

<div id="thongTin" class="modal hide" aria-hidden="true" style="display: none;">
    <div class="modal-header">
        <button data-dismiss="modal" class="close" type="button">×</button>
        <h3 runat="server" id="txtTieuDe">Thông tin chi tiết</h3>
    </div>
    <div class="modal-body">
        <div class="control-group">
            <label class="control-label">Tên Giảng Viên : </label>
            <div class="controls">
                <asp:Label ID="txtten" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Số điện thoại: </label>
            <div class="controls">
                <asp:Label ID="txtSoDT" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Địa Chỉ : </label>
            <div class="controls">
                <asp:Label ID="txtDiaChi" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Tên Đơn Vị: </label>
            <div class="controls">
                <asp:Label ID="txtDonVi" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Tên Chức Vụ: </label>
            <div class="controls">
                <asp:Label ID="txtChucVu" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Số CMT: </label>
            <div class="controls">
                <asp:Label ID="txtSoCMT" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Chuyên Môn : </label>
            <div class="controls">
                <asp:Label ID="txtChuyenMon" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Học Vấn : </label>
            <div class="controls">
                <asp:Label ID="txtHocVan" runat="server"></asp:Label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Ghi chú: </label>
            <div class="controls">
                <asp:Label ID="txtGhiChu" runat="server"></asp:Label>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <a data-dismiss="modal" class="btn" href="#" id="cancel">Hủy</a>
    </div>

</div>

<script>
    function Display(TenGV, SDT, DonVi, ChucVu, HocVan, DiaChi, SoCMT, ChuyenMon, GhiChu) {
        $('#<%= txtDiaChi.ClientID%>').text(DiaChi);
        $('#<%= txtSoCMT.ClientID%>').text(SoCMT);
        $('#<%= txtChuyenMon.ClientID%>').text(ChuyenMon);
        $('#<%= txtGhiChu.ClientID%>').text(GhiChu);
        $('#<%= txtten.ClientID%>').text(TenGV);
        $('#<%= txtSoDT.ClientID%>').text(SDT);
        $('#<%= txtDonVi.ClientID%>').text(DonVi);
        $('#<%= txtChucVu.ClientID%>').text(ChucVu);
        $('#<%= txtHocVan.ClientID%>').text(HocVan);
    }
</script>



